package com;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.*;

public class Log {
    private static final Logger logger = Logger.getLogger("MyLogger");
    private static final SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    /**
     * 格式化时间，用于输出日志
     */
    private static String currentTime(){
        return sfd.format(new Date());
    }

    /**
     * 设置消息
     */
    public static void msg(String msg){
        logger.info(currentTime()+" "+msg);
    }
}
